<template>
    <!-- pages/permission/index.wxml -->

    <view class="per">
        <button type="primary" @tap="openSetting">打开权限设置</button>
    </view>
</template>

<script>
// pages/permission/index.js
export default {
    data() {
        return {};
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (options) {},
    methods: {
        openSetting(e, _dataset) {
            
            if (!e.currentTarget) {
                if (_dataSet.tagId) {
                    e.currentTarget = {
                        id: _dataSet.tagId
                    };
                } else {
                    e.currentTarget = {
                        dataset: _dataSet
                    };
                }
            }
            
            //打开权限设置
            uni.openSetting({
                success(res) {
                    // console.log(res.authSetting)
                    // res.authSetting = {
                    //   "scope.userInfo": true,
                    //   "scope.userLocation": true
                    // }
                }
            });
        }
    }
};
</script>
<style>
@import './index.css';
</style>
